using System;
using Ease.EaseNode.Runtime;
using Ease.EaseNode.Runtime.Param;
using Ease.TestEaseNode.Runtime.Param;
using Sirenix.OdinInspector;
using UnityEngine;

namespace Ease.TestEaseNode.Runtime
{
#if UNITY_EDITOR
    public class TestDataState : BaseEaseNodeDataState<TestData>
    {
        public override event Action<BaseChangeParam> OnValueChangeEvent;

        public TestDataState(TestData data)
        {
            this.data = data;
        }

        public override void OnValueChange(BaseChangeParam param)
        {
            base.OnValueChange(param);
            OnValueChangeEvent?.Invoke(param);
        }

        [SerializeField] [InlineButton(nameof(TestChangeState))]
        private NodeState _nodeState;

        private void TestChangeState()
        {
            OnValueChangeEvent?.Invoke(new StateChangeParam() {newState = _nodeState});
        }
    }
#endif
}